//
//  UIView+Create.h
//  HAFund
//

#import <UIKit/UIKit.h>
#import "Masonry.h"

@interface UIView (Create)

/**
 快速创建View方法

 @param color 创建view的背景色
 @param frame 创建view的frame
 @param superView 创建view的父视图
 @param maker 创建view的约束
 @return 创建view
 */
+ (UIView *)viewWithColor:(UIColor *)color
                    frame:(CGRect)frame
                superView:(UIView *)superView
          constraintMaker:(void(^)(MASConstraintMaker *make))maker;

@end


@interface UIButton (Create)

/**
 快速创建button的方法

 @param title 创建button标题
 @param frame 创建button的Frame
 @param font 创建button的fontSize
 @param titleColor titleColor
 @param imageName button图片
 @param backgroundImage button背景图片
 @param target button事件响应者(Normal)
 @param action button事件响应方法(Normal)
 @param superView 父视图
 @param maker button约束
 @return 创建的button
 */
+ (UIButton *)buttonTitle:(NSString *)title
                    frame:(CGRect)frame
                     font:(NSInteger)font
               titleColor:(UIColor *)titleColor
                imageName:(id)imageName
           backgroundImge:(id)backgroundImage
                   target:(id)target
                   action:(SEL)action
                superView:(UIView *)superView
          constraintMaker:(void(^)(MASConstraintMaker *make))maker;

@end


@interface UILabel (Create)

/**
 快速创建label的方法

 @param title label的text
 @param titleColor textColor
 @param font 文字fontSize
 @param frame laebl的frame
 @param superView label父视图
 @param maker label约束
 @return 创建的label
 */
+ (UILabel *)labelWithTitle:(NSString *)title
                 titleColor:(UIColor *)titleColor
                       font:(CGFloat)font
                      frame:(CGRect)frame
                  superView:(UIView *)superView
            constraintMaker:(void (^)(MASConstraintMaker *make))maker;

@end


@interface UIImageView (Create)

/**
 快速创建imageView方法

 @param imageName image图片名称
 @param frame imageView的frame
 @param superView imageView的父视图
 @param make imageView的约束
 @return 创建的imageView
 */
+ (UIImageView *)imageViewWithImageName:(id)imageName
                                  frame:(CGRect)frame
                              superView:(UIView *)superView
                        constraintMaker:(void (^)(MASConstraintMaker *make))make;

@end
